package cn.fzm.controller;

import cn.fzm.exception.SysException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Dremeue
 * @create 2019-10-07 20:01
 **/
@Controller
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/testException")
    public String testException() throws SysException {
        System.out.println("测试异常...");

        try {
            int a = 1 / 0;
        } catch (Exception e) {
            e.printStackTrace();
            throw new SysException("查询所有用户出错");
        }

        return "success";
    }
}
